package org.thirdHero.wx.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.thirdHero.db.rabbitmq.RabbitSender;


/**
 * @title 消息消费端
 * @author zengzp
 * @time 2018年8月20日 上午11:00:26
 * @Description 
 */
@Component
public class RabbitMqConsumer {
    private static final Logger log = LoggerFactory.getLogger(RabbitSender.class);


    /*
     rabbit消费者
    @RabbitListener(queues = RabbitConfig.Timeout_Trade_Queue_Name)
    public void process(String freshOrderId, Message message, Channel channel) throws IOException{
        log.info("【消费队列--订单超时未处理,时间:{},订单id:{}】===============处理订单超时未支付====================", LocalDateTime.now(),freshOrderId);
        try {
            log.info("开始执行订单[{}]的支付超时订单关闭......", freshOrderId);
            freshOrderService.payOrderOverTime(freshOrderId);
            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
            log.info("超时订单处理完毕");
        } catch (Exception e) {
            log.error("【错误消息:{}】============消费失败,尝试消息补发再次消费!==============",e.getMessage());
            channel.basicReject(message.getMessageProperties().getDeliveryTag(), true);
        } 
    }*/
}